package com.com.effectivejava.objectcreation;

/**
 * Created by pankaj on 7/6/14.
 */
public class StaticClassIntialization {
    public int i;

    // static would be called first.
    // in between static block and static method,
    // order of execution depends on their
    // order of appearance in the .java file.
    // in this case block would be called first.

    static{
        System.out.println("Static Initializer Called !!!");
    }

    public static StaticClassIntialization instance = staticMethod();


    public static StaticClassIntialization staticMethod(){
        System.out.println("Static Method Called !!!");
        return null;
    }

    public StaticClassIntialization(){
        System.out.println("Constructor Called !!!");
        this.i=0;
    }

    public static void main(String... a){
        System.out.println("Main Method Called !!!");
        new StaticClassIntialization();
    }

}
